import Vue from 'vue'
import App from './App.vue'
import VueKonva from 'vue-konva'
import VueHttp from 'vue-resource'
import Router from 'vue-router'
import Moment from 'vue-moment'

import routes from './router/routes.js'

Vue.use(VueKonva)
Vue.use(VueHttp)
Vue.config.productionTip = false
Vue.use(Router)
Vue.use(Moment)

const router = new Router({
    routes, // (缩写) 相当于 routes: routes
})

router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        document.title = to.meta.title
    }
    next()
})

new Vue({
    router,
    render: h => h(App),
}).$mount('#app')
